#include "cd_exception.h"
#include "cd_object.h"

CD_NAMESPACE_BEGIN


c_object	c_inecps::g_inner_ecepts[INBED_EXCEPTION_MAX_NO];

s32			c_inecps::exception_no(c_object* except)
{
	s32		dist	=	(s32)(except	-	g_inner_ecepts);
	if(dist	<	0	
		||	dist	>	INBED_EXCEPTION_MAX_NO
		||	dist	%	4)	return	-1;
	return	dist;
}

c_object*	c_inecps::exception_at(u32 index)
{
	if(index	>	INBED_EXCEPTION_MAX_NO)	return	0;
	return	&g_inner_ecepts[index];
}


CD_NAMESPACE_END